
import { getCityAPI } from '@/services/modules/citysAPI';
import { defineStore } from 'pinia'


const useCityStore = defineStore('city', {
    state: () => ({
        allCity: {}, //所有城市
        currentCity: { cityName: '三亚' }, //当前选择的城市

    }),
    actions: {
        /* 获取城市数据actions */
        async getCityData() {

            //调用getCityAPI接口发请求
            const { data: res } = await getCityAPI();
            console.log('getCityAPI---', res.data);
            this.allCity = res.data;

        },

    }
})

export default useCityStore